package com.viewhigh.wechat.sdk.base;

import com.viewhigh.framework.common.cache.redis.RedisCachedManager;
import com.viewhigh.framework.common.runtime.ApplicationContextHolder;

/**
 * @Title: BaseCache.java
 * @Package com.viewhigh.wechat.sdk.base
 * @Description: 基础缓存
 * @author liusongqing
 * @Company www.viewhigh.com
 * @date 2016年9月26日 下午10:02:27
 * @version V1.0
 */
public class BaseCache {

    protected static final String KEY_WX_ACCESSTOKEN = "supplywxapi:sdk:wx:accesstoken:appid:%s";
    protected static final String KEY_WX_ACCOUNT = "supplywxapi:sdk:wx:account:appid:%s";
    protected static final String KEY_WX_TEMPLATE = "supplywxapi:sdk:wx:template:appid:%s";
    protected static final int DEFAULT_EXPIRE_DAY_360 = 60 * 60 * 24 * 360;
    /**
     * token有效期 半小时（单位秒）
     */
    public static final int WX_VALIDTOKEN_EXPIRE_TIME = 30 * 60;
    // 模板id保存时间为30天
    public static final int WX_VALIDTOKEN_TEMPLATE_TIME = 60 * 60 * 24 * 30;
    protected static RedisCachedManager cache = ApplicationContextHolder.getBean(RedisCachedManager.class);

}
